package com.stylefeng.guns.modular.customer.warpper;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;
import com.stylefeng.guns.core.common.constant.factory.ConstantFactory;
import com.stylefeng.guns.modular.customer.util.CustomerUtil;
import org.apache.commons.collections.MapUtils;

import java.util.Map;

public class ContactWrapper extends BaseControllerWarpper {

    public ContactWrapper(Object o) {
        super(o);
    }

    protected void warpTheMap(Map<String, Object> map) {
        Integer customerCompanyId = MapUtils.getInteger(map, "customerCompanyId");
        String customerCompanyName = ConstantFactory.me().getCustomerCompanyName(customerCompanyId);
        map.put("customerCompanyName", customerCompanyName);
        CustomerUtil.putAuthority(map, customerCompanyId);
    }
}
